{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Se inicializa a simula\u00e7\u00e3o para um grupo de particulas numa dimens\u00e3o (1D). Como primeiro caso N = 5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%run Gas.py"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 51
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gas_old = Gas(9)\n",
      "gas_new = Gas(9)\n",
      "gas_old.iniVel(0.2)\n",
      "gas_new.iniVel(0.2)\n",
      "gas_ini = copy.deepcopy(gas_old)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 52
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gas_ini.vec_v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 53,
       "text": [
        "array([[ 0.2663173 ,  0.        ,  0.        ],\n",
        "       [ 0.14305579,  0.        ,  0.        ],\n",
        "       [-0.30908006,  0.        ,  0.        ],\n",
        "       [-0.00167677,  0.        ,  0.        ],\n",
        "       [ 0.12426719,  0.        ,  0.        ],\n",
        "       [-0.14401711,  0.        ,  0.        ],\n",
        "       [ 0.05310232,  0.        ,  0.        ],\n",
        "       [ 0.02170971,  0.        ,  0.        ],\n",
        "       [ 0.00085829,  0.        ,  0.        ]])"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gamma  = 1.0\n",
      "Tleft  = 1.0\n",
      "Tright = 1.5\n",
      "Wrange = 1.0\n",
      "dt = 0.00001\n",
      "total_time =400000"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 89
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#enerDensTemp = np.zeros(total_time*gas_old.N).reshape(total_time,gas_old.N)\n",
      "#fluxDensTemp = np.zeros(total_time*gas_old.N).reshape(total_time,gas_old.N)\n",
      "#xt = np.zeros(total_time*gas_old.N).reshape(total_time,gas_old.N)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 90
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "timeDim = 200\n",
      "gasTime = GasTime(gas_old,timeDim)\n",
      "taux = total_time/timeDim"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 91
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Esta simula\u00e7\u00e3o n\u00e3o tem banho t\u00e9rmico. Ouseja devemos esperar uma conserva\u00e7\u00e3o da energia.\n",
      "A vari\u00e1vel enerDensTemp que salva a densidade de energia para cada paritcula deve sumar sempre o mesmo.\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "######\n",
      "# FIXME: Redundant two lines\n",
      "gas_old.calculateDeltas()\n",
      "gas_old.calculateForces()\n",
      "for i in range(total_time):    \n",
      "    \n",
      "    gas_new.stepPosition(gas_old,dt)\n",
      "    gas_new.inBox(gas_old)\n",
      "    \n",
      "    gas_new.calculateDeltas()\n",
      "    gas_new.calculateForces()\n",
      "    gas_new.stepVelocity(gas_old, dt)\n",
      "    \n",
      "    gas_new.calculateHalfV()\n",
      "    gas_new.calculateEkin_n()\n",
      "    gas_new.calculateEnerDensity()  # h_n\n",
      "    gas_new.calculateFluxDensity()  # j_n\n",
      "    \n",
      "    if i % taux == 0:\n",
      "        gasTime.saveMicroState(gas_new, i, dt)\n",
      "        gasTime.saveState(gas_new, i, dt)\n",
      "    \n",
      "    #enerDensTemp[i] = gas_new.enerDensity\n",
      "    #fluxDensTemp[i] = gas_new.fluxDensity[:,0]\n",
      "    #xt[i][0] = gas_old.vec_r[0][0]\n",
      "    #xt[i][1] = gas_old.vec_r[1][0]\n",
      "    #xt[i] = gas_old.vec_r[:,0]\n",
      "    #gas_new.calculateEpot()\n",
      "    #gas_new.calculateEkin()\n",
      "    #gas_new.calculateFlux()\n",
      "    \n",
      "    #save the values for the next step\n",
      "    gas_old = copy.deepcopy(gas_new)\n",
      "    \n",
      "    #plt.plot(range(len(gas_old.Ekin_n)), gas_old.Ekin_n)\n",
      "\n",
      "######\n",
      "gas_end = copy.deepcopy(gas_new)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 1 2"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 3 4"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 5 6"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 7 8"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 9 10"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 11 12"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 13 14"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 15 16"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 17 18"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 19 20"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 21 22"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 23 24"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 25 26"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 27 28"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 29 30"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 31 32"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 33 34"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 35 36"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 37 38"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 39 40"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 41 42"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 43 44"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 45 46"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 47 48"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 49 50"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 51 52"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 53 54"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 55 56"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 57 58"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 59 60"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 61 62"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 63 64"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 65 66"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 67 68"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 69 70"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 71 72"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 73 74"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 75 76"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 77 78"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 79 80"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 81 82"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 83 84"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 85 86"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 87 88"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 89 90"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 91 92"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 93 94"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 95 96"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 97 98"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 99 100"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 101 102"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 103 104"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 105 106"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 107 108"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 109 110"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 111 112"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 113 114"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 115 116"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 117 118"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 119 120"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 121 122"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 123 124"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 125 126"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 127 128"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "2.19790114109e-07 -0.473858523195 -5.00000021979\n",
        "2.19790114109e-07 0.473858523195 -4.99999978021 ***** 0\n",
        " 129"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 130 131"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 132 133"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 134 135"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 136 137"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 138 139"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 140 141"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 142 143"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 144 145"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 146 147"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 148 149"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 150 151"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 152 153"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 154 155"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 156 157"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 158 159"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 160 161"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 162 163"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 164 165"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 166 167"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 168 169"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 170 171"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 172 173"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 174 175"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 1768.30691891274e-07"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " -0.539987986044 -5.00000083069\n",
        "8.30691891274e-07 0.539987986044 -4.99999916931 ***** 0\n",
        " 177"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 178 179"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 180 181"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 182 183"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 184 185"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 186 187"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 188 189"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 190 191"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 192 193"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 194 195"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 196 197"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 198 199"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 200"
       ]
      }
     ],
     "prompt_number": 92
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasTime.fluxDenst[0].sum()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 46,
       "text": [
        "0.049422319206680915"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.grid()\n",
      "plt.rc('font', size=25)\n",
      "plt.rc('text', usetex=True)\n",
      "plt.plot(gasTime.time,gasTime.fluxDenst.sum(axis=1))\n",
      "plt.xlabel(\"$t$\")\n",
      "plt.ylabel(\"$j_{tot}$\")\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 119
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.grid()\n",
      "plt.rc('font', size=25)\n",
      "plt.rc('text', usetex=True)\n",
      "plt.plot(gasTime.time,gasTime.enerDenst.sum(axis=1))\n",
      "plt.xlabel(\"$t$\")\n",
      "plt.ylabel(\"$E_{tot}$\")\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 120
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fig, ax = plt.subplots()\n",
      "plt.title(\"$ j_{x_n} $\")\n",
      "plt.ylabel(\"$t$ steps\")\n",
      "plt.xlabel(\"$n$\")\n",
      "#plt.colorbar()\n",
      "#heatmap = ax.pcolor(enerDensTemp, cmap='RdBu')#plt.cm.Blues) #[:,1:gas_old.N-2]\n",
      "heatmap = ax.pcolor(gasTime.fluxDenst, cmap='RdBu')#plt.cm.Blues)\n",
      "fig.colorbar(heatmap)\n",
      "#plt.imshow(enerDensTemp[:,1:gas_old.N-2])\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 103
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Grafica das posi\u00e7\u00f5es das part\u00edculas"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.grid()\n",
      "plt.rc('font', size=30)\n",
      "plt.rc('text', usetex=True)\n",
      "plt.ylabel(\"$v_x$\")\n",
      "plt.xlabel(\"$t$\")\n",
      "for i in range(gas_old.N):\n",
      "    plt.plot(gasTime.time, gasTime.vxt[:,i])\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 118
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.grid()\n",
      "plt.rc('font', size=30)\n",
      "plt.rc('text', usetex=True)\n",
      "plt.ylabel(\"$v$\")\n",
      "plt.xlabel(\"$t$\")\n",
      "plt.plot(gasTime.time, gasTime.vxt[:,0],'o')\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 117
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gas_ini.plot()\n",
      "gas_end.plot()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 107
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gas_ini.calculateDeltas()\n",
      "gas_ini.calculateHalfV()\n",
      "gas_ini.calculateEkin_n()\n",
      "gas_ini.calculateEnerDensity()\n",
      "gas_ini.calculateFluxDensity()\n",
      "print gas_ini.fluxDensity.sum(), gas_ini.enerDensity.sum()\n",
      "print gas_end.fluxDensity.sum(), gas_end.enerDensity.sum()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "-0.00401938256292 0.139652490695\n",
        "-0.0857579603098 0.139652490798\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "A densidade total de energia esta se conservando. Mas o fluxo deveria ter sido zero "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fluxDensTemp.sum(axis)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 63,
       "text": [
        "0.054938355226009573"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.plot(time,fluxDensTemp)\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 57
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "len(enerDensTemp)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 75,
       "text": [
        "100000"
       ]
      }
     ],
     "prompt_number": 75
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Pode-se notar que a energia n\u00e3o esta sendo conservada o qual deveria ter acontecido para este caso. Por tanto vamos denovo passo a passo"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%run Gas.py\n",
      "gasIni=Gas(9)\n",
      "gasAux=Gas(9)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 47
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.vec_r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 48,
       "text": [
        "array([[-4. , -0.5,  0. ],\n",
        "       [-3. , -0.5,  0. ],\n",
        "       [-2. , -0.5,  0. ],\n",
        "       [-1. , -0.5,  0. ],\n",
        "       [ 0. , -0.5,  0. ],\n",
        "       [ 1. , -0.5,  0. ],\n",
        "       [ 2. , -0.5,  0. ],\n",
        "       [ 3. , -0.5,  0. ],\n",
        "       [ 4. , -0.5,  0. ]])"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.calculateDeltas()\n",
      "gasIni.deltaX"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 49,
       "text": [
        "array([[ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.],\n",
        "       [-1.,  0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.],\n",
        "       [-2., -1.,  0.,  1.,  2.,  3.,  4.,  5.,  6.],\n",
        "       [-3., -2., -1.,  0.,  1.,  2.,  3.,  4.,  5.],\n",
        "       [-4., -3., -2., -1.,  0.,  1.,  2.,  3.,  4.],\n",
        "       [-5., -4., -3., -2., -1.,  0.,  1.,  2.,  3.],\n",
        "       [-6., -5., -4., -3., -2., -1.,  0.,  1.,  2.],\n",
        "       [-7., -6., -5., -4., -3., -2., -1.,  0.,  1.],\n",
        "       [-8., -7., -6., -5., -4., -3., -2., -1.,  0.]])"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.calculateForces()\n",
      "gasIni.Fx[7].sum()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 71,
       "text": [
        "0.015044104303775896"
       ]
      }
     ],
     "prompt_number": 71
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.force[7]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 72,
       "text": [
        "array([ 0.0150441,  0.       ,  0.       ])"
       ]
      }
     ],
     "prompt_number": 72
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.rc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 33,
       "text": [
        "2.5"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.calculateForces()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 34
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.Fx[0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 35,
       "text": [
        "array([ 0.        ,  2.40155998, -0.0150441 ,  0.        ,  0.        ,\n",
        "        0.        ,  0.        ,  0.        ,  0.        ])"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.force"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 73,
       "text": [
        "array([[  2.38651587e+00,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.50441043e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.04083409e-16,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.04083409e-16,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.04083409e-16,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.04083409e-16,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -1.04083409e-16,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  1.50441043e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [ -2.38651587e+00,   0.00000000e+00,   0.00000000e+00]])"
       ]
      }
     ],
     "prompt_number": 73
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasAux.stepPosition(gasIni,dt)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 88
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "(0.1*gasAux.vec_v)**2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 104,
       "text": [
        "array([[  3.98952589e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  1.15115403e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  5.37358964e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  1.58150114e-06,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  8.68631383e-03,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  1.16667723e-02,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  1.58616905e-03,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  2.65112605e-04,   0.00000000e+00,   0.00000000e+00],\n",
        "       [  4.14368538e-07,   0.00000000e+00,   0.00000000e+00]])"
       ]
      }
     ],
     "prompt_number": 104
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "PhiSF(0.6,1,gasIni.eps,gasIni.rc, gasIni.PhiLJ_rc, gasIni.DrPhiLJOverr_rc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 103,
       "text": [
        "6.727574981231751"
       ]
      }
     ],
     "prompt_number": 103
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasAux.calculateDeltas()\n",
      "gasAux.calculateForces()\n",
      "gasAux.force"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 92,
       "text": [
        "array([[ 2.42876711,  0.        ,  0.        ],\n",
        "       [ 0.10131319,  0.        ,  0.        ],\n",
        "       [-0.26166052,  0.        ,  0.        ],\n",
        "       [ 0.06044569,  0.        ,  0.        ],\n",
        "       [ 0.13576743,  0.        ,  0.        ],\n",
        "       [-0.15972747,  0.        ,  0.        ],\n",
        "       [ 0.0773761 ,  0.        ,  0.        ],\n",
        "       [ 0.01140432,  0.        ,  0.        ],\n",
        "       [-2.39368583,  0.        ,  0.        ]])"
       ]
      }
     ],
     "prompt_number": 92
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "gasIni.DrPhiLJOverr_rc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 107,
       "text": [
        "0.0015599790981120005"
       ]
      }
     ],
     "prompt_number": 107
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "DrPhiLJOverr(2.5**2,1, 0.1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 92,
       "text": [
        "0.0015599790981120005"
       ]
      }
     ],
     "prompt_number": 92
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "FSFAxis(2.5**2,-2.5,1.0,0.1,gasIni.DrPhiLJOverr_rc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 91,
       "text": [
        "-0.0"
       ]
      }
     ],
     "prompt_number": 91
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "ejex**2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 11,
       "text": [
        "array([ 0.81  ,  0.8281,  0.8464,  0.8649,  0.8836,  0.9025,  0.9216,\n",
        "        0.9409,  0.9604,  0.9801])"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "ejex = np.arange(0.9,3,0.01)\n",
      "ejey = np.zeros(len(ejex))\n",
      "for i in range(len(ejex)):\n",
      " ejey[i] = PhiSF((ejex[i]**2), 1.0, 0.1, 2.5, gasIni.PhiLJ_rc, gasIni.DrPhiLJOverr_rc)\n",
      "#ejey = FSFAxis(ejex,-1.0,1.0,0.1,gasIni.DrPhiLJOverr_rc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 26
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "plt.grid()\n",
      "plt.plot(ejex,ejey)\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 37
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "PhiSF(1.0, 1.0, 0.1, 2.5, gas_ini.PhiLJ_rc, gas_ini.DrPhiLJOverr_rc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 42,
       "text": [
        "0.005726634246144001"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "DrPhiLJOverr(1.0,1.0,0.1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 40,
       "text": [
        "-2.4000000000000004"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}